import logging,yamail,HTMLTestRunner_cn

class Toools():
    def log(self):
        log = logging.basicConfig(level= logging.DEBUG,
                                  filemode='a+',
                                  filename=r'E:\gg4\PythonProject1\week3_93\Log\jiuxian.log',
                                  format='%(filename)s-%(asctime)s-%(message)s-%(levelname)s-%(lineno)d')
        return log

    def report(self):
        report = HTMLTestRunner_cn.HTMLTestRunner(open(r'E:\gg4\PythonProject1\week3_93\Report\jiuxian.html','wb'),
                                                  title='酒仙业务',
                                                  description='酒仙测试通过')
        return report

    # yotehzrzfsvgdeii
    def mail(self):
        mail = yamail.SMTP(user='3080172040@qq.com',password='yotehzrzfsvgdeii',host='smtp.qq.com',port=465)
        mail.send(to='3080172040@qq.com',subject='酒仙项目',contents=['酒仙测试通过',
                                                                      r'E:\gg4\PythonProject1\week3_93\Log\jiuxian.log',
                                                                      r'E:\gg4\PythonProject1\week3_93\Report\jiuxian.html'])
        mail.close()